package com.easy.query.test.entity.proxy;

import com.easy.query.core.expression.parser.core.available.TableAvailable;
import com.easy.query.core.proxy.AbstractProxyEntity;
import com.easy.query.core.proxy.SQLColumn;
import com.easy.query.core.proxy.SQLSelectAsExpression;
import com.easy.query.core.proxy.fetcher.AbstractFetcher;
import com.easy.query.core.proxy.core.EntitySQLContext;
import com.easy.query.test.entity.Topic;
import com.easy.query.core.proxy.columns.SQLStringColumn;
import com.easy.query.core.proxy.columns.SQLNumberColumn;
import com.easy.query.core.proxy.columns.SQLDateTimeColumn;

/**
 * this file automatically generated by easy-query, don't modify it
 * 当前文件是easy-query自动生成的请不要随意修改
 * 如果出现属性冲突请使用@ProxyProperty进行重命名
 *
 * @author xuejiaming
 */
public class TopicProxy extends AbstractProxyEntity<TopicProxy, Topic> {

    private static final Class<Topic> entityClass = Topic.class;

    public static TopicProxy createTable() {
        return new TopicProxy();
    }

    public TopicProxy() {
    }

    /**
     * {@link Topic#getId}
     */
    public SQLStringColumn<TopicProxy, java.lang.String> id() {
        return getStringColumn("id", java.lang.String.class);
    }

    /**
     * {@link Topic#getStars}
     */
    public SQLNumberColumn<TopicProxy, java.lang.Integer> stars() {
        return getNumberColumn("stars", java.lang.Integer.class);
    }

    /**
     * {@link Topic#getTitle}
     */
    public SQLStringColumn<TopicProxy, java.lang.String> title() {
        return getStringColumn("title", java.lang.String.class);
    }

    /**
     * {@link Topic#getCreateTime}
     */
    public SQLDateTimeColumn<TopicProxy, java.time.LocalDateTime> createTime() {
        return getDateTimeColumn("createTime", java.time.LocalDateTime.class);
    }

    /**
     * {@link Topic#getAlias}
     */
    public SQLStringColumn<TopicProxy, java.lang.String> alias() {
        return getStringColumn("alias", java.lang.String.class);
    }


    @Override
    public Class<Topic> getEntityClass() {
        return entityClass;
    }


    /**
     * 数据库列的简单获取
     *
     * @return
     */
    public TopicProxyFetcher FETCHER = new TopicProxyFetcher(this, null, SQLSelectAsExpression.empty);


    public static class TopicProxyFetcher extends AbstractFetcher<TopicProxy, Topic, TopicProxyFetcher> {

        public TopicProxyFetcher(TopicProxy proxy, TopicProxyFetcher prev, SQLSelectAsExpression sqlSelectAsExpression) {
            super(proxy, prev, sqlSelectAsExpression);
        }


        /**
         * {@link Topic#getId}
         */
        public TopicProxyFetcher id() {
            return add(getProxy().id());
        }

        /**
         * {@link Topic#getStars}
         */
        public TopicProxyFetcher stars() {
            return add(getProxy().stars());
        }

        /**
         * {@link Topic#getTitle}
         */
        public TopicProxyFetcher title() {
            return add(getProxy().title());
        }

        /**
         * {@link Topic#getCreateTime}
         */
        public TopicProxyFetcher createTime() {
            return add(getProxy().createTime());
        }

        /**
         * {@link Topic#getAlias}
         */
        public TopicProxyFetcher alias() {
            return add(getProxy().alias());
        }


        @Override
        protected TopicProxyFetcher createFetcher(TopicProxy cp, AbstractFetcher<TopicProxy, Topic, TopicProxyFetcher> prev, SQLSelectAsExpression sqlSelectExpression) {
            return new TopicProxyFetcher(cp, this, sqlSelectExpression);
        }
    }

}
